/**
 created by xwy 2018/3/20 14:51
 user: 13720092498@163.com
 **/

import {INCREMENT, DECREMENT, RESET} from '../actions/counter'

const initState = {
  count: 0
}


const reducer = (state = initState, action) => {
  switch (action.type) {
    case INCREMENT:
      return {
        count: state.count + 1
      }
    case DECREMENT:
      return {
        count: state.count - 1
      }
    case RESET:
      return {
        count: 0
      }
    default:
      return state
  }
}
export default reducer